package com.itheima.model.behavior.pojos;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 图书热度实体类 (MongoDB)
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Document(collection = "book_popularity")
public class BookPopularity implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    private String id;

    @Field("book_id")
    @Indexed(unique = true)
    private Integer bookId;

    @Field("view_count")
    private Integer viewCount;

    @Field("reading_count")
    private Integer readingCount;

    @Field("like_count")
    private Integer likeCount;

    @Field("collect_count")
    private Integer collectCount;

    @Field("note_count")
    private Integer noteCount;

    @Field("review_count")
    private Integer reviewCount;

    @Field("popularity_score")
    @Indexed
    private BigDecimal popularityScore;

    @Field("create_time")
    private Date createTime;

    @Field("update_time")
    private Date updateTime;
}
